app.controller('moreController', ['$scope', '$stateParams', '$rootScope', '$state', function($scope, $stateParams, $rootScope, $state) {
		//总项目名称
		$rootScope.product = "/wechat_mt5";
		//滞空要不angular不识别
		$scope.shop = {
			list: " ",
			infoList: "",
			xList: "",
		}

		//微信获取code值
		var code;
		if(window.location.search) {
			code = window.location.search.split("?code=")[1].split("&")[0];

		} else {
			code = "lalala";
		}
		//如果返回上一级是#/做以下判断
		//	$(function() {
		//
		//		pushHistory();
		//
		//		window.addEventListener("popstate", function(e) {
		//			if(window.location.hash == "#/") {
		//				$.ajax({
		//					type: "get",
		//					url: $rootScope.product + "/mt/user/judge/login/status",
		//					success: function(data) {
		//						if(data.data) {
		//							lookLevel();
		//						} else {
		//							window.location.href = "#/login"
		//						}
		//					}
		//				});
		//
		//			}
		//
		//		}, false);
		//
		//		function pushHistory() {
		//			var state = {
		//				title: "title",
		//				url: "#/"
		//			};
		//			window.history.pushState(state, "title", "#/");
		//		}
		//  });

		$.ajax({
			type: "get",
			url: $rootScope.product + "/wx/redirect",
			//			async: false,
			data: {
				code: code
					//				code: "lalala"
			},
			success: function(data) {
				//				openId = data.data;
				if(data.code == 0) {

					lookLevel();

				}
				if(data.data == 2) {
					window.location.href = "#/login";
					mui.alert("登陆失败！")
				}

			},
			error: function(data) {

			}
		});

		var openId;

		//登录页面
		$scope.onlogin = function() {

				if($('#lusername').val() == "" || $('#lpassword').val() == "") {
					mui.alert("请输入账号密码!");
				} else {
					$.ajax({
						type: "post",
						url: $rootScope.product + "/user/binding",
						data: {
							mail: $('#lusername').val(),
							password: $('#lpassword').val()

						},
						success: function(data) {
							if(data.code == 0) {

								switch(data.data) {
									case 1:
										mui.alert("用户名不存在!");
										break;
									case 2:
										mui.alert("此用户已绑定!");
										break;
									case 3:
										mui.alert("密码错误!");
										break;
									case 4:
										mui.alert("错误!");
										break;
									case 5:
										window.location.href = "#/bind"
										break;
									case 6:
										lookLevel();
										break;
								}
							} else if(data.code == 10010012) {
								mui.alert("登陆失败，此账号已被冻结！");
							}

						},
						error: function(data) {

						}
					});
				}

			}
			//注册页面
		$scope.onzc = function() {
				if($('#zpassword').val() == "" || $('#zpassword2').val() == "") {
					mui.alert("请输入密码!");
				} else if($('#zpassword').val() != $('#zpassword2').val()) {
					mui.alert("确认密码错误!");
				} else if($('#zemail').val() == "") {
					mui.alert("邮箱不能为空!");
				} else if(emailGe($('#zemail').val()) == false) {
					return false;
				} else if($('#zpassword').val().length < 6 || $('#zpassword').val().length > 16) {
					mui.alert("密码长度6到16位之间！")
				} else {

					$.ajax({
						type: "post",
						url: $rootScope.product + "/user/register",
						data: {

							password: $('#zpassword').val(),
							mail: $('#zemail').val(),
							mailValidationCode: $('#zcode').val(),

						},
						success: function(data) {

							if(data.code == 0) {
								if(data.data) {
									lookLevel();
									mui.alert("恭喜您注册成功！");

								} else {
									mui.alert("注册失败，请重新注册！");
								}
							} else if(data.code == 10010007) {
								mui.alert("注册失败，验证码错误！");
							} else if(data.code == 10010014) {
								mui.alert("注册失败，邮箱已注册！");
							}

						},
						error: function(data) {

						}
					});
				}

			}
			//邮箱是否重复
		function repeatMail() {

			$.ajax({
				type: "get",
				url: $rootScope.product + "/user/validate/mail",

				data: {
					mail: $('#zemail').val()
				},
				success: function(data) {
					if(data.data) {
						mui.alert("此邮箱已注册")

					}
				}
			});
		}

		//邮箱格式

		//			lookLevel();
		//查看状态 （是否绑定过）
		function lookLevel() {
			$.ajax({
				type: "get",
				url: $rootScope.product + "/mt/user/find/mt/info",

				success: function(data) {

					if(data.code == 0) {
						if(data.data == "") {
							window.location.href = "#/level"
						} else {
							clearAll();
							//0是大牛
							if(data.data.type == "0") {
								window.location.href = "#/daniel/info";

							} else {
								window.location.href = "#/follow/info";

							}
							$scope.myChi = [];
							chi();
							$scope.mtLogin = data.data.mtLogin;
							$scope.hasInfo = true;
							$scope.dontGen = false;
							if(data.data.state == "1") {
								$scope.waite = true;
								$scope.dontGen = true;

							} else if(data.data.state == "2") {

								$scope.waiteNo = true;
								$scope.dontGen = true;

							}
							genCan();
							myInfo();

							$scope.$apply();
						}

					}

				},
				error: function(data) {

				}
			});
		}
		//更改密码
		$scope.changePass = function() {
				if($('#changepassword2').val().length < 6 || $('#changepassword2').val().length > 16) {
					mui.alert("密码长度6到16位之间！")
				} else {
					$.ajax({
						type: "put",
						url: "/wechat_mt5/user/update/pwd",
						data: {
							password: $("#changepassword1").val(),
							newPassword: $("#changepassword2").val(),

						},
						success: function(data) {
							if(data.data) {

								mui.alert("更改成功");
								lookLevel()
							} else {
								mui.alert("更改失败")
							}
						}
					});
				}

			}
			//点击变更账户
		$scope.changeAccount = function() {
				bangAccount();
				window.location.href = "#/addAccount";
			}
			//切换账号列表
		function bangAccount() {
			$.ajax({
				type: "get",
				url: $rootScope.product + "/mt/user/get/mts",

				success: function(data) {
					if(data.data) {
						$scope.accountList = data.data;
						for(x in data.data) {
							if(data.data[x].status == "1") {
								$scope.accountList.updateTimeOld = data.data[x].updateTime;
								break;
							}
						}
					}
					console.log($scope.accountList)
					$scope.$apply();

				}
			});
		}
		//数据源
		$scope.lodading = true;
		$scope.shopList = [];
		var offset = 0;
		var shop_chiOffset = 0;
		var shop_historyOffset = 0;
		var my_chiOffset = 0;
		var my_HistoryOffset = 0;

		//下拉刷新
		$(function() {

				$(document).on("swipe", function() {
					var inner = $(window).innerHeight();
					var scrollTop = $('.scroll').scrollTop();
					//大牛列表
					console.log(scrollTop)
					if($scope.noShopList != true) {
						if($("#list").height() - 100 <= (inner + scrollTop)) {
							offset += 10;
							shopList();
						}

					}
					//商品列表
					if($scope.shop_noChiList != true) {
						if($("#shopListBox").height() - 100 <= (inner + scrollTop)) {
							shop_chiOffset += 10;
							shopChi();
						}

					}

					if($scope.shop_noHistoryList != true) {
						if($("#shopListBox2").height() - 100 <= (inner + scrollTop)) {
							shop_historyOffset += 10;
							shopHistory();
						}

					}
					//个人刷新
					if($scope.info_noChiList != true) {
						if($("#infoListBox").height() <= (inner + scrollTop)) {
							my_chiOffset += 10;
							chi();

							

						}
						

					}

					if($scope.info_noHistoryList != true) {
						if($("#infoListBox2").height() - 100 <= (inner + scrollTop)) {
							my_HistoryOffset += 10;
							myHistory()
						}

					}

				});
			})
			//数据源列表
		function shopList() {
			clearAll();
			$.ajax({
				type: "get",
				url: $rootScope.product + "/data/list",
				data: {

					offset: offset
				},
				success: function(data) {
					console.log(data)

					if(data.code == 0) {
						$scope.lodading = false;
						$scope.noShopList = scrollFuction($scope.shopList, data.data, $scope.noShopList);
					}
					$scope.$apply();

				}
			});

		}

		//查看更多
		$scope.moreList = function(id, x) {

				$scope.moreshopListName = x;
				$scope.shopMoreId = id;

				//当前持仓
				$scope.shopPing = [];
				shopChi();

			}
			//点击切换大牛的订单、历史、个人资料

		$scope.changeShopList = function(choose) {
				$scope.shop.list = choose;
				offset = 0;
				shop_chiOffset = 0;
				shop_historyOffset = 0;
				my_chiOffset = 0;
				my_HistoryOffset = 0;
				switch(choose) {
					case 1:
						$scope.shopPing = [];
						shopChi();
						break;
					case 2:
						$scope.shopLiPing = [];
						shopHistory();
						break;
					case 3:
						shopMoreInfo();
						break;

				}
			}
			//点击切换个人的订单、历史、个人资料
		$scope.changeInfoList = function(choose) {
				$scope.shop.infoList = choose;
				offset = 0;
				shop_chiOffset = 0;
				shop_historyOffset = 0;
				my_chiOffset = 0;
				my_HistoryOffset = 0;
				switch(choose) {
					case 1:
						$scope.myChi = [];
						chi();
						break;
					case 2:
						$scope.myHistory = [];
						myHistory();
						break;
					case 3:
						myInfo();
						break;

				}
			}
			//大牛列表更多之持仓
		$scope.shopPing = [];

		function shopChi() {

			var type = window.location.hash;
			$.ajax({
				type: "get",
				url: $rootScope.product + "/data/more/position",
				data: {
					mtLogin: $scope.shopMoreId,
					offset: shop_chiOffset

				},
				success: function(data) {

					if(data.code == 0) {
						if(data.data.length == 0) {
							if(shop_chiOffset == 0) {
								$scope.noShuChi = true;
								$scope.shopPing = "";
								$scope.shop_noChiList = false;
							} else {
								$scope.shop_noChiList = true;
							}

						} else {
							$scope.noShuChi = false;

							$scope.shop_noChiList = scrollFuction($scope.shopPing, data.data, $scope.shop_noChiList);

						}

						if(type.indexOf("#/follow") != -1) {
							window.location.href = "#/follow/more"

						} else {
							window.location.href = "#/daniel/more"
						}

					}

					$scope.$apply();

				}
			});
		}

		//大牛列表更多之历史记录
		$scope.shopLiPing = [];

		function shopHistory() {
			$.ajax({
				type: "get",
				url: $rootScope.product + "/data/more/history",
				data: {
					mtLogin: $scope.shopMoreId,
					offset: shop_historyOffset

				},
				success: function(data) {

					if(data.code == 0) {

						if(data.data.length == 0) {
							if(shop_historyOffset == 0) {
								$scope.noShuLu = true;
								$scope.shopLiPing = [];
								$scope.shop_noHistoryList = false;
							} else {
								$scope.shop_noHistoryList = true;
							}

						} else {

							$scope.noShuLu = false;
							$scope.shop_noHistoryList = scrollFuction($scope.shopLiPing, data.data, $scope.shop_noHistoryList);
							$scope.$apply();
						}

					}

					$scope.$apply();

				}
			});
		}
		//大牛列表详情
		function shopMoreInfo() {
			$.ajax({
				type: "get",
				url: $rootScope.product + "/data/more/details",
				data: {
					mtLogin: $scope.shopMoreId,
				},
				success: function(data) {

					if(data.code == 0) {

						if(data.data) {

							$scope.shopMoreInfo = data.data[0];

						}

					}

					$scope.$apply();

				}
			});
		}

		$scope.goonList = function() {
			window.location.href = "#/documentary";

		}

		//个人当前持仓

		function chiNull() {
			$scope.myChi = [];
			chi();
		}

		$scope.myChi = [];

		function chi() {
			$.ajax({
				type: "get",
				url: $rootScope.product + "/mt/user/myself/position",
				data: {

					offset: my_chiOffset
				},
				success: function(data) {

					if(data.code == 0) {

						if(data.data.length == 0) {
							if(my_chiOffset == 0) {
								$scope.noRecord = true;
								$scope.hasRecord = false;
								$scope.waite = false;
								$scope.info_noChiList = false;
							} else {
								$scope.info_noChiList = true;
							}

						} else {

							$scope.hasRecord = true;
							$scope.waite = false;
							$scope.noRecord = false;
							//						$scope.myChi = data.data;
							$scope.info_noChiList = scrollFuction($scope.myChi, data.data, $scope.info_noChiList);
							//							console.log(scrollFuction($scope.myChi, data.data, $scope.info_noChiList))
							$scope.$apply();

						}
					} else {
						$scope.myChi = "";
					}

					$scope.$apply();

				}
			});
		}
		$scope.myHistory = [];
		//个人历史记录
		function myHistory() {
			$.ajax({
				type: "get",
				url: $rootScope.product + "/mt/user/myself/history",
				data: {

					offset: my_HistoryOffset
				},
				success: function(data) {

					if(data.code == 0) {
						if(data.data.length == 0) {
							if(my_HistoryOffset == 0) {
								$scope.noLu = true;
								$scope.info_noHistoryList = false;
								$scope.waite = false;
							} else {
								$scope.info_noHistoryList = true;
							}

						} else {

							$scope.hasLu = true;
							$scope.waite = false;
							$scope.noLu = false;
							//							$scope.myHistory = data.data;
							$scope.info_noHistoryList = scrollFuction($scope.myHistory, data.data, $scope.info_noHistoryList);

						}

					}
					//					else if(data.code == 10030001) {
					//						lookLevel();
					//						mui.alert("您还没有审核成功的mt账号,请重新绑定！")
					//					} 
					else {
						$scope.myHistory = "";
					}
					$scope.$apply();
				}

			});
		}
		//	myHistory()
		//点击个人时候
		$scope.changeInfo = function() {
				offset = 0;
				shop_chiOffset = 0;
				shop_historyOffset = 0;
				my_chiOffset = 0;
				my_HistoryOffset = 0;
				$scope.myChi = [];
				$scope.myHistory = [];
				lookLevel();
				//更新个人持仓
				chi();
				myHistory();

				myInfo();

				//个人历史	 
				//			var type = window.location.hash;
				//			if(type.indexOf("#/follow") != -1) {
				//				window.location.href = "#/follow/info"
				//			} else {
				//				window.location.href = "#/daniel/info"
				//			}

			}
			//点击数据源
		$scope.listShopDown = function(type) {
			offset = 0;
			shop_chiOffset = 0;

			shop_historyOffset = 0;
			my_chiOffset = 0;
			my_HistoryOffset = 0;
			$scope.shopList = [];
			$scope.lodading = true;
			offset = 0;
			shopList();
			genCan();

			if(type == 1) {

				window.location.href = "#/follow/list";

			} else {

				window.location.href = "#/daniel/list";

			}

		}

		//平仓按钮
		$scope.ping = function(id) {
			mui.confirm("您确定要平仓吗？", function(e) {
				if(e.index == "1") {
					$.ajax({
						type: "put",
						url: $rootScope.product + "/mt/user/close/trade",
						data: {
							order: id,
						},
						success: function(data) {
							if(data.code == 0) {
								if(data.data) {
									var time = setTimeout(function() {
										my_chiOffset = 0;
										$scope.myChi = [];
										chi();
										mui.alert("平仓成功！");
									}, 800)

								} else {
									$scope.myChi = [];
									chi();
									mui.alert("平仓失败！");
								}

								$scope.$apply();
							}

						}
					});
				}
			})
		}

		function clearAll() {
			$scope.waite = false;
			$scope.waiteNo = false;
			$scope.noRecord = false;
			$scope.hasRecord = false;
			$scope.noLu = false;
			$scope.hasLu = false;
			$scope.hasInfo = false;
		}
		$scope.changeState = function(id, state, type, newTime, oldTime) {

			genCan();
			clearAll();

			$scope.hasInfo = true;
			if(state == "1") {
				//				$scope.waite = true;
				//			$scope.mtLogin = id;

				mui.alert("您账号" + id + "正在审核中！");

			} else if(state == "2") {
				//				$scope.waiteNo = true;
				mui.alert("您账号" + id + "审核失败！");
			} else {
				$.ajax({
					type: "put",
					url: $rootScope.product + "/mt/user/update/online",
					data: {

						mtLogin: id,
						updateTimeOld: oldTime * 1,
						updateTimeNew: newTime * 1
					},
					success: function(data) {
						if(data.code == 0) {
							bangAccount();
							$scope.myChi = [];
							chi();
							myInfo();
							$scope.myHistory = [];
							myHistory();
							bangAccount();
							if(type == "1") {
								window.location.href = "#/follow/info";
							} else {
								window.location.href = "#/daniel/info";
							}
						} else {
							mui.alert("切换失败");
							$scope.myChi = [];
							chi();
							myInfo();
							$scope.myHistory = [];
							myHistory();
						}

					}
				});

			}

		}

		//	myInfo();
		//个人信息

		function myInfo() {
			$.ajax({
				type: "get",
				url: $rootScope.product + "/mt/user/myself/details",

				success: function(data) {

					if(data.code == 0) {
						$scope.infoList = data.data[0];

						$scope.dontGen = false;
						$scope.waite = false;
						$scope.available = '0';
					}
					//					else if(data.code == 10030001) {
					//					    clearAll();
					//						mui.alert("您还没有审核成功的mt账号,请重新绑定！")
					//					}
					else {
						//     if(data.error.code=="700020040"){
						//				$scope.waite=true;
						//     	 
						//     }
						if(data.error.code == "700020027") {
							$scope.waite = true;
						}
						$scope.infoList = data.data;
						$scope.available = '1';
						$scope.dontGen = true;
					}
					$scope.$apply;
				}
			});
		}

		//跟单设置
		$scope.changeSet = function(num, id) {
				console.log(num)
				if(num == 1) {
					$scope.noCansel = true;
					$scope.gendan = true;
					$scope.xiugai = false;
					window.location.href = "#/documentary";
				} else {
					$scope.xiugai = true;
					$scope.gendan = false;
					$scope.noCansel = false;

					$.ajax({
						type: "get",
						url: $rootScope.product + "/follow/get/param",
						data: {
							sourceLogin: id,

						},
						success: function(data) {

							if(data.data) {

								$scope.maxmoney = data.data.rate;
								$scope.dontCM = $scope.maxmoney + $scope.dontCM
								$scope.gendanTime = data.data.updateTime;
								//							$scope.bringId = data.data.id;
								window.location.href = "#/documentary";

								if(data.data.type == 1) {
									$scope.typeColor = "bgGreen";

								} else {
									$scope.typeColor = "lightGray";

								}

							}

						}
					});

				}

				$scope.sureHasId = id
					//		$scope.$apply($scope.sureHasId)

			}
			//确定跟单
		$scope.sureGoShop = function(service) {

				// 0 跟单  1 修改
				var type;
				if($('#pingChoose .yesBtn').hasClass("bgGreen")) {
					type = 1;
				} else {
					type = 0;
				}

				if($scope.maxmoney > 0) {
					if(service == 0) {
						$.ajax({
							type: "post",
							url: $rootScope.product + "/follow/create/param",
							data: {

								type: type,
								rate: $scope.maxmoney,
								sourceLogin: $scope.sureHasId,

							},
							success: function(data) {

								if(data.code == 0) {
									$scope.shopList = [];
									offset = 0
									shopList();
									window.location.href = "#/follow/list";
									mui.alert("跟单成功！");
									genCan();

								} else {
									mui.alert("跟单失败！");
								}
							}
						});
					} else {
						$.ajax({
							type: "put",
							url: $rootScope.product + "/follow/update/param",
							data: {
								sourceLogin: $scope.sureHasId,
								type: type,
								rate: $scope.maxmoney,

								updateTime: $scope.gendanTime

							},
							success: function(data) {

								if(data.code == 0) {
									$scope.shopList = [];
									offset = 0;
									shopList();
									window.location.href = "#/follow/list";
									mui.alert("更改成功！");
									genCan();

								} else {
									mui.alert("更改失败！");
								}

							}
						});
					}
				} else {
					mui.alert("跟单比例不能为0")
				}
			}
			//取消跟单
		$scope.canselGen = function() {
			var type;
			
				if($('#cansel .bgGreen').prev().html() == '立即平仓正在跟随的订单并解除跟单') {
					type = 1;
				} else {
					type = 2;
				}
			
          
			$.ajax({
				type: "post",
				url: $rootScope.product + "/follow/delete/param",
				data: {

					riskType: type,
					sourceLogin: $scope.sureHasId,

				},
				success: function(data) {
					if(data.code == 0) {
						$scope.shopList = [];
						offset = 0;
						shopList();
						window.location.href = "#/follow/list";
						mui.alert("取消成功！");
						genCan();

					} else {
						mui.alert("取消失败！");
					}

				}

		})
   }
		function genCan() {
			$.ajax({
				type: "get",
				url: $rootScope.product + "/mt/user/get/myself/rate/surplus",

				success: function(data) {
					console.log(data);

					if(data.code == 0) {
						$scope.money = data.data.value;
						$scope.maxmoney = data.data.rate;
						$scope.dontCM = data.data.rate;

					}
				}
			});
		}
		//设置跟单参数

		$scope.setCount = function() {
			$scope.newMoney = ($scope.money * $scope.maxmoney / 100).toFixed(2);
			mui.confirm("<p id='changeMoney'>" + '$' + $scope.newMoney + "</p><p class='red'>(此设置将于下次交易成功)</p>", "<span>请输入跟单比例 <input type='text' value=" + $scope.maxmoney + " class='mynumber' id='myNumber' min='0' max='100'   />%</span>", ["取消", "确定"],
				function(e) {
					if(e.index == "1") {
						console.log($('.mynumber').val())
						$scope.maxmoney = $('.mynumber').val();
						$scope.$apply();
					}
				}, 'div')

			$('#myNumber').bind('input propertychange', function() {
				var re = /\./g
				if($(this).val() % 1 != 0) {
					mui.alert("请输入整数！");
					$(this).val(0)
				}

				if(re.test($(this).val())) {
					mui.alert("请输入整数！");
					$(this).val(0)
				}

				if($(this).val() > $scope.dontCM) {
					mui.alert("最大跟单比例为" + $scope.dontCM + "%");
					$(this).val($scope.dontCM);
					$('#changeMoney').html("$" + $scope.newMoney)
				} else if($(this).val() < 0) {
					mui.alert("最小跟单比例为1%");
					$(this).val(1);
					var num = $(this).val() / 100 * $scope.money;
					$('#changeMoney').html("$" + num.toFixed(2))
					$('#changeMoney').html("$" + num.toFixed(2))

				} else {
					var num = $(this).val() / 100 * $scope.money;
					$('#changeMoney').html("$" + num.toFixed(2))
				}

			})

		}
		$scope.canselList = function() {
			window.location.href = "#/canselList"
		}

		//	var bol=true;
		//	if(bol){
		//		event.preventDefault();
		//		window.location.href="#/"
		//	}

		//绑定
		$scope.sureBang = function() {

			var type = window.location.hash.split("?")[1];

			$scope.id = $('#zh').val();

			if(checkAll() == false) {
				return false;
			} else {

				$.ajax({
					type: "post",
					url: $rootScope.product + "/mt/user/binding/mt",

					data: {

						mtLogin: $('#zh').val() * 1,
						mobile: $('#phone').val(),
						type: type,
						name: $('#shopName').val(),
						pwd:$('#pwd').val()

					},
					success: function(data) {
						if(data.code == 0) {
							if(data.data == 0) {
								window.location.href = "#/addAccount";
								//						bangAccount();
								mui.alert("<p>您的申请已经提交，我们将在两个工作日开通，请您耐心等候</p>", "账号<span style='color:#2B92D9;margin-left:5px'>" + $scope.id + "</span>");
								lookLevel();

							} else if(data.data == 1) {
								mui.alert("此账号已被绑定!");

							} else if(data.data == 2) {
								mui.alert("请耐心等待上个申请审核通过!");

							} else {
								mui.alert("操作失败，请稍后重试！");
							}

						}

						if(data.code == 10010007) {
							$('#pass2').val("验证码错误");
							$('#pass2').css("color", "red");
						}
						if(data.code == 10010009) {
							$('#zh').val("请输入您的MT5真实账户号码");
							$('#zh').css("color", "red");
						}
						if(data.code == 10030004) {
							mui.alert("MT5密码错误");
						}

					}
				});

			}
		}

		//大牛列表排行榜
		$scope.changeRank_win = function(num) {
			$scope.shop.xList = num;
		}

		$scope.rankSure = function() {
			var num
			$('#screen .box').each(function() {
				if($(this).hasClass("active")) {
					var olTxt = $(this).children("p").text();
					$(".getWin").each(function(x, y) {
						var newTxt = $(".getWin").eq(x).children("p").text()
						if(newTxt == olTxt) {
							num = $(this)[0].outerHTML.split("==")[1].split("}")[0];
						}
					})

					//					.children()
				}

			})
			num *= 1;

			if(num >= 4 && num <= 8) {
				oWidth = ($(window).width() - $(".more").width()) + "px";

				$("#scrollIn .mui-row").css("right", oWidth)
			}
			if(num > 8 && num <= 10) {
				oWidth = ($(window).width() - $(".more").width()) * 2 + "px";

				$("#scrollIn .mui-row").css("right", oWidth)
			}
			$scope.shop.xList = num;
			$("#mask").hide();
			$("#screen").hide();;

			//		  $(function() {
			//			 
			//			 
			//		 })
		}

	}])
	//自定义交易时长
app.filter('transactionDay', function() {
		return function(value) {
			var start = new Date(value);
			var end = new Date();
			var difference = end.getTime() - start.getTime()
			return days = Math.floor(difference / (24 * 3600 * 1000)) + "天"

		}
	})
	//下拉刷新